import React, { useEffect, useState } from 'react'
import { Row, Col, Input, Space, Button, Modal } from "antd";
const ModalSet = (props) => {
    const { visible, onClose, onOk } = props
    console.log(onClose, 'onClose')
    const [value, setValue] = useState('')
    useEffect(() => {
        if (!visible) {
            setValue('')
        }
    }, [visible])
    const modalProps = {
        title: `批量设置 `,
        open: visible,
        width: 600,
        maskClosable: true,
        destroyOnClose: true,
        zIndex: 1001,
        onCancel: onClose,
        onOk: () => {
            onOk && onOk(value)
            onClose()
        }
    };
    return <Modal {...modalProps}>
        <Input.TextArea
            value={value}
            showCount={false}
            rows={5}
            placeholder='每行可输入一个筛选项，回车键可换行'
            onChange={(e) => {
                setValue(e.target.value)
            }}
        />
    </Modal>
}
export default ModalSet